package qc.module.ehs.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.ehs.dto.staffsignin.StaffSignInDto;
import qc.module.ehs.entity.EhsStaffSignInRecord;

import java.util.List;

/**
 * EhsStaffSigninMapper
 *
 * @author QuCheng Tech
 * @since 2025/6/24
 */
@Mapper
public interface EhsStaffSignInRecordMapper {
    EhsStaffSignInRecordMapper MAPPER = Mappers.getMapper(EhsStaffSignInRecordMapper.class);

    /**
     * entity -> dto
     *
     * @param en
     * @return
     */
    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "intm", source = "intm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    StaffSignInDto toDto(EhsStaffSignInRecord en);

    /**
     * List<entity> -> List<dto>
     *
     * @param ens
     * @return
     */
    List<StaffSignInDto> toDtoList(List<EhsStaffSignInRecord> ens);
}
